import os
path_now = os.getcwd()

lists_ano = os.listdir(path_now+"\\Annotations\\")
lists_img = os.listdir(path_now+"\\Images\\")

for list_ano in lists_ano:
    ano_name = list_ano.split(".")[0]
    flag = 0
    for list_img in lists_img:
        img_name = list_img.split(".")[0]
        if ano_name == img_name:
            flag = 0
            break
        else:
            flag = 1
            continue
    if flag == 1 :
        os.remove(path_now+"\\Annotations\\"+list_ano)
